package com.deyuanyun.pic.ctrl.controller.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.deyuanyun.pic.common.util.StringUtils;
import com.deyuanyun.pic.common.util.poi.annotation.ExcelWriteColumn;
import com.deyuanyun.pic.ctrl.enumeration.ExceptionHandlingStateEnum;

import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 *  阴极保护跨接线运行记录展示DTO
 *  @author axiao(xj08.dream@gmail.com)
 *  @date 2016-09-19
 *  @version 1.0
 *  Histroy: [修改人][时间][描述]
 */
public class RecodeCpJumperDTO {

    private String id;

    /**
     * 设备编号
     */
    @ExcelWriteColumn
    private String customNumber;

    private String cpjumperId;

    /**
     * 测试桩编号
     */
    private String testStationId;

    /**
     * 测试桩设备编号
     */
    @ExcelWriteColumn
    private String testCustomNumber;

    /**
     * 跨接线连通时电位（mV）
     */
    @ExcelWriteColumn
    public Long crosswireConnecttion;

    /**
     * 跨接线断开后电位（mV）1
     */
    @ExcelWriteColumn
    public Long crosswireDisConnection1;

    /**
     * 连接管道名称1
     */
    @ExcelWriteColumn
    private String connectingPipeName1;

    /**
     * 跨接线断开后电位（mV）2
     */
    @ExcelWriteColumn
    public Long crosswireDisConnection2;

    /**
     * 连接管道名称2
     */
    @ExcelWriteColumn
    private String connectingPipeName2;

    /**
     * 跨接线断开后电位（mV）3
     */
    @ExcelWriteColumn
    public Long crosswireDisConnection3;

    /**
     * 连接管道名称3
     */
    @ExcelWriteColumn
    private String connectingPipeName3;

    /**
     * 跨接线焊点检查
     */
    @ExcelWriteColumn
    private String solderJointInspection;

    /**
     * 是否有异常
     */
    private boolean hasException;

    /**
     * 异常编号（若无异常则为空）PIC_CTRL_RECODE_EXCEPTION.ID_
     */
    private String exceptionId;

    /**
     * 异常记录
     */
    @ExcelWriteColumn
    private String exceptionRecord;

    /**
     * 异常状态
     */
    private String exceptionStated;

    /**
     * 处理记录
     */
    @ExcelWriteColumn
    private String treatRecord;

    /**
     * 记录人（直接存名称）
     */
    @ExcelWriteColumn
    private String recorder;

    /**
     * 记录时间
     */
    @ExcelWriteColumn
    private Date recordTime;

    /**
     * 备注
     */
    @ExcelWriteColumn
    private String remarks;

    private String imagePath; //图片路径，数据库返回使用，前台不需要

    private List<String> imagePaths; //图片路径集合，前台需要的

    @JSONField(serialize = false)
    public String getImagePath() {
        return imagePath;
    }

    public void setImagePath(String imagePath) {
        this.imagePath = imagePath;
    }

    public List<String> getImagePaths() {
        if(StringUtils.isNotEmpty(imagePath)) {
            return Arrays.asList(imagePath.split(","));
        }
        return imagePaths;
    }

    public void setImagePaths(List<String> imagePaths) {
        this.imagePaths = imagePaths;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCustomNumber() {
        return customNumber;
    }

    public void setCustomNumber(String customNumber) {
        this.customNumber = customNumber;
    }

    public String getCpjumperId() {
        return cpjumperId;
    }

    public void setCpjumperId(String cpjumperId) {
        this.cpjumperId = cpjumperId;
    }

    public String getTestStationId() {
        return testStationId;
    }

    public void setTestStationId(String testStationId) {
        this.testStationId = testStationId;
    }

    public String getTestCustomNumber() {
        return testCustomNumber;
    }

    public void setTestCustomNumber(String testCustomNumber) {
        this.testCustomNumber = testCustomNumber;
    }

    public Long getCrosswireConnecttion() {
        return crosswireConnecttion;
    }

    public void setCrosswireConnecttion(Long crosswireConnecttion) {
        this.crosswireConnecttion = crosswireConnecttion;
    }

    public Long getCrosswireDisConnection1() {
        return crosswireDisConnection1;
    }

    public void setCrosswireDisConnection1(Long crosswireDisConnection1) {
        this.crosswireDisConnection1 = crosswireDisConnection1;
    }

    public String getConnectingPipeName1() {
        return connectingPipeName1;
    }

    public void setConnectingPipeName1(String connectingPipeName1) {
        this.connectingPipeName1 = connectingPipeName1;
    }

    public Long getCrosswireDisConnection2() {
        return crosswireDisConnection2;
    }

    public void setCrosswireDisConnection2(Long crosswireDisConnection2) {
        this.crosswireDisConnection2 = crosswireDisConnection2;
    }

    public String getConnectingPipeName2() {
        return connectingPipeName2;
    }

    public void setConnectingPipeName2(String connectingPipeName2) {
        this.connectingPipeName2 = connectingPipeName2;
    }

    public Long getCrosswireDisConnection3() {
        return crosswireDisConnection3;
    }

    public void setCrosswireDisConnection3(Long crosswireDisConnection3) {
        this.crosswireDisConnection3 = crosswireDisConnection3;
    }

    public String getConnectingPipeName3() {
        return connectingPipeName3;
    }

    public void setConnectingPipeName3(String connectingPipeName3) {
        this.connectingPipeName3 = connectingPipeName3;
    }

    public String getSolderJointInspection() {
        return solderJointInspection;
    }

    public void setSolderJointInspection(String solderJointInspection) {
        this.solderJointInspection = solderJointInspection;
    }

    public boolean isHasException() {
        return hasException;
    }

    public void setHasException(boolean hasException) {
        this.hasException = hasException;
    }

    public String getExceptionId() {
        return exceptionId;
    }

    public void setExceptionId(String exceptionId) {
        this.exceptionId = exceptionId;
    }

    public String getExceptionRecord() {
        return exceptionRecord;
    }

    public void setExceptionRecord(String exceptionRecord) {
        this.exceptionRecord = exceptionRecord;
    }

    public String getExceptionStated() {
        if(StringUtils.isNotEmpty(exceptionStated))
            return ExceptionHandlingStateEnum.valueOf(exceptionStated).getLabel();
        return null;
    }

    public void setExceptionStated(String exceptionStated) {
        this.exceptionStated = exceptionStated;
    }

    public String getTreatRecord() {
        return treatRecord;
    }

    public void setTreatRecord(String treatRecord) {
        this.treatRecord = treatRecord;
    }

    public String getRecorder() {
        return recorder;
    }

    public void setRecorder(String recorder) {
        this.recorder = recorder;
    }

    public Date getRecordTime() {
        return recordTime;
    }

    public void setRecordTime(Date recordTime) {
        this.recordTime = recordTime;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }
}
